home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / graphics / amicad / arexx_english / newscript.amicad < prev    next >
Text File  |  1999-12-06  |  1KB  |  46 lines

  1. /* NewScript.AmiCAD, 22 mai 1999 © R.Florac, version 1.02e */
  2. /* This script loads a new script in an editor for editing.
  3.    It's written for my text editor, Amitex. Adapt it to your
  4.    own editor to suit to your needs. */
  5. /* Press the CTRL key while selecting an ARexx menu entry
  6.    to call this script under AmiCAD */
  7.  
  8. signal on error             /* for error handling */
  9. signal on syntax
  10.  
  11. options results
  12. cr='0a'x
  13.  
  14. port = ADDRESS()                    /* reads the ARexx port name */
  15.  
  16. address command
  17. if ~show(p, "AMITEX") then do
  18.     f=0                 /* the editor was not running */
  19.     'run > nil:' "c:AmiTex"         /* loads the editor */
  20.     waitforport "AMITEX"
  21. end
  22. else f=1                /* it was allready running */
  23.  
  24. ADDRESS(AMITEX)
  25.  
  26. if f=1 then 'NEW("New.AmiCAD")'     /* ask for opening a new window */
  27. 'LOAD("Work:AmiCAD/ARexx/New.AmiCAD")'  /* loads the script "New.AmiCAD" */
  28.  
  29. 'ASKTEXT("What''s the name'cr'of this new script ?", ".AmiCAD")'               /* ask for the title */
  30. titre = result
  31. if titre ~= "" then 'FILENAME("Work:AmiCAD/ARexx/'titre'")'     /* rename the window */
  32. 'GOTO(1,10)'
  33.  
  34. exit
  35.  
  36. syntax:
  37. address (port)
  38. erreur=RC
  39. 'MESSAGE("Script NewScript.amiCAD :"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  40. exit
  41.  
  42. error:
  43. address (port)
  44. 'MESSAGE("Script NewScript.amiCAD :"+CHR(10)+"Error in line 'SIGL'")'
  45. exit
  46.